﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 匿名类型
{
    class Program
    {
        static void Main(string[] args)
        {
            var bob = new { Name = "smith", Age = 37 };
            Console.WriteLine("bob： " + bob.ToString() + "\n");

            var steve = new { Name = "steve", Age = 37 };
            Console.WriteLine("steve: " + steve.ToString() + "\n");

            Console.WriteLine("bob is {0} equal to steve\n", bob.Equals(steve) ? string.Empty : "not");

            var bob2 = new { Name = "smith", Age = 37 };
            Console.WriteLine("bob is {0} equal to bob2\n", bob.Equals(bob2) ? string.Empty : "not");

            Console.ReadKey();
        }
    }
}
